package br.com.financeiro.dominio;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;

@Entity
public class Conta implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_CONTA")
	@SequenceGenerator(name = "SEQ_CONTA", sequenceName = "id_seq_conta", allocationSize = 1)
	@Column(name="id_conta")
	private int id;
	
	private double valor;
	
	private Date data;
	
	private boolean credito;
	
	@ManyToOne
	@JoinColumn(name="id_tipoconta")
	private TipoConta tipoConta;
	
	@ManyToOne
	@JoinColumn(name="id_usuario")
	private Usuario usuarioConta;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public double getValor() {
		return valor;
	}

	public void setValor(double valor) {
		this.valor = valor;
	}

	public Date getData() {
		return data;
	}

	public void setData(Date data) {
		this.data = data;
	}

	public boolean isCredito() {
		return credito;
	}

	public void setCredito(boolean credito) {
		this.credito = credito;
	}

	public TipoConta getTipoConta() {
		return tipoConta;
	}

	public void setTipoConta(TipoConta tipoConta) {
		this.tipoConta = tipoConta;
	}

	public Usuario getUsuarioConta() {
		return usuarioConta;
	}

	public void setUsuarioConta(Usuario usuarioConta) {
		this.usuarioConta = usuarioConta;
	}
}
